/* 左侧控制面板 */
.control-panel {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* 横向导航栏 */
.panel-tabs {
  display: flex;
  background: #f8f9fa;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid #e9ecef;
}

.tab-button {
  flex: 1;
  padding: 15px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6c757d;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px 10px 0 0;
}

.tab-button:hover {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
}

.tab-button.active {
  background: white;
  color: #007bff;
  border-bottom: 2px solid #007bff;
}

/* 设置面板 */
.settings-panel {
  padding: 20px;
  flex: 1;
}

.setting-group {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e9ecef;
}

.setting-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.setting-group h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 数据模式选择器 */
.data-mode-selector {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.data-mode-selector label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.data-mode-selector input[type="radio"] {
  margin: 0;
}

/* 数据大小输入 */
.data-size-input {
  margin-bottom: 15px;
}

.data-size-input label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.data-size-input input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.data-size-input input[type="number"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 生成按钮 */
.generate-btn {
  width: 100%;
  padding: 10px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.generate-btn:hover {
  background: #218838;
}

/* 自定义数据输入 */
.custom-data-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-data-input label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.custom-data-input textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  min-height: 60px;
}

.custom-data-input textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.error-message {
  color: #dc3545;
  font-size: 12px;
  margin-top: 5px;
}

/* 当前数据显示 */
.current-data {
  margin-top: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 14px;
}

.data-display-text {
  margin-top: 5px;
  font-family: 'Courier New', monospace;
  color: #666;
}

/* 速度控制 */
.speed-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speed-control label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.speed-control input[type="range"] {
  flex: 1;
}

.speed-control span {
  font-size: 12px;
  color: #666;
  min-width: 60px;
}

/* 控制按钮 */
.control-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.control-btn {
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.control-btn.start {
  background: #28a745;
  color: white;
}

.control-btn.start:hover:not(:disabled) {
  background: #218838;
}

.control-btn.step {
  background: #17a2b8;
  color: white;
}

.control-btn.step:hover:not(:disabled) {
  background: #138496;
}

.control-btn.pause {
  background: #ffc107;
  color: #212529;
}

.control-btn.pause:hover:not(:disabled) {
  background: #e0a800;
}

.control-btn.stop {
  background: #dc3545;
  color: white;
}

.control-btn.stop:hover:not(:disabled) {
  background: #c82333;
}

/* 状态信息 */
.status-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.status-item .label {
  font-weight: 500;
  color: #333;
}

.status-item .value {
  color: #666;
  font-family: 'Courier New', monospace;
}

.status-item .value.success {
  color: #28a745;
  font-weight: 600;
}

/* 聊天面板 */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
}

/* 快速问题 */
.quick-questions {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e9ecef;
}

.quick-questions h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.question-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-btn {
  padding: 10px 15px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: all 0.3s ease;
  color: #333;
}

.question-btn:hover {
  background: #e9ecef;
  border-color: #007bff;
  color: #007bff;
}

/* 聊天区域 */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 欢迎消息 */
.welcome-message {
  display: flex;
  gap: 12px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.ai-avatar {
  font-size: 24px;
  flex-shrink: 0;
}

.welcome-message .message-content p {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}

.welcome-message .message-content p:last-child {
  margin-bottom: 0;
}

/* 消息样式 */
.message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  font-size: 20px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f8f9fa;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message.user .message-content {
  background: #007bff;
  color: white;
  padding: 10px 15px;
  border-radius: 15px 15px 5px 15px;
  max-width: 80%;
  margin-left: auto;
}

.message.ai .message-content {
  background: #f8f9fa;
  padding: 10px 15px;
  border-radius: 15px 15px 15px 5px;
  border: 1px solid #e9ecef;
  max-width: 90%;
}

.message-content p {
  margin: 0 0 8px 0;
  line-height: 1.5;
  font-size: 14px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 5px;
}

.message.ai .message-time {
  color: #999;
}

/* 输入区域 */
.chat-input-area {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

.input-container {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.input-container input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  resize: none;
}

.input-container input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.send-btn {
  padding: 10px 15px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn:hover:not(:disabled) {
  background: #0056b3;
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 打字指示器 */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 行内代码样式 */
.inline-code {
  background-color: #f1f3f4;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #d73a49;
  border: 1px solid #e1e4e8;
  display: inline;
  white-space: nowrap;
}
